package com.wc.算法基础课.A第一讲基础算法.递归.约数之和;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/3/13 10:51
 * @description https://www.acwing.com/problem/content/99/
 */
public class Main {
    static int a, b;
    static int P = 9901;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        long b = sc.nextInt();
        if (a == 1 || b == 0) {
            System.out.println(1);
            return;
        } else if (a == 0) {
            System.out.println(0);
            return;
        }

        Map<Integer, Integer> map = new HashMap<>();
        for (int i = 2; i * i <= a; i++) {
            if (a % i == 0) {
                int num = 0;
                while (a % i == 0) {
                    a /= i;
                    num++;
                }
                map.put(i, num);
            }
        }
        if (a > 1) map.put(a, 1);
        long res = 1;
        for (Map.Entry<Integer, Integer> kv : map.entrySet()) {
            int k = kv.getKey();
            long v = kv.getValue();
            // 要考虑 k - 1是否是P的倍数，是的话是没有逆元的
            if ((k - 1) % P == 0) {
                long sum = 0;
                long f = 1;
                v = v * b;
                while (v-- >= 0) {
                    sum = (sum + f) % P;
                    f = f * k % P;
                }
                res = res * sum % P;
            } else {
                res = (res * (qkm(k, v * b + 1) - 1 + P) * qkm(k - 1, P - 2)) % P;
            }
        }
        System.out.println(res);
    }

    static int qkm(long a, long b) {
        if (a == 0) return 0;
        long res = 1;
        while (b > 0) {
            if ((b & 1) == 1) res = res * a % P;
            a = a * a % P;
            b >>= 1;
        }

        return (int) res;
    }

    static long mod(long a) {
        return (a % P + P) % P;
    }
}
